package com.tistory.risk.dao;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.orm.ibatis.SqlMapClientTemplate;
import org.springframework.stereotype.Repository;

import com.tistory.admin.adminmgr.auth.model.LoginUserInfo;
import com.tistory.common.vo.CommonReq;
import com.tistory.credit.vo.CreditRes;
import com.tistory.login.vo.MemberRes;

@Repository("RiskDaoImpl")
public class RiskDaoImpl implements RiskDao {

	@Autowired
	SqlMapClientTemplate sqlMapClientTemplate;
	
	public void setSqlMapClientTemplate(SqlMapClientTemplate sqlMapClientTemplate) {
		this.sqlMapClientTemplate = sqlMapClientTemplate;
	}

	
	@Override
	public LoginUserInfo getUser(Map<String,Object> map) throws SQLException {
		
		return (LoginUserInfo) sqlMapClientTemplate.queryForObject("LoginSql.getUser", map);
	}

	
	

	@Override
	public List<MemberRes> getMemberList(CommonReq req) throws SQLException {
		List<MemberRes> mmberList = sqlMapClientTemplate.queryForList("LoginSql.getMemberList",  req);
		return mmberList;
	}


	@Override
	public Integer getMemberListCount(CommonReq req) throws SQLException {
		return (Integer) sqlMapClientTemplate.queryForObject("LoginSql.getMemberListCount", req);
	}
	
}
